<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'listLibrary.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/demo.css" />  

<link rel="stylesheet" href="${pageContext.request.contextPath}/css/zTreeStyle.css" />  

<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.4.min.js"></script> 

<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.ztree.core-3.5.js"></script>  
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.ztree.excheck-3.5.js"></script>  
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.ztree.exedit-3.5.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.ztree.exhide-3.5.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath}/js/zTreeUtils.js"></script>

		<!--
        	作者：chinasofti
        	时间：2018-01-25
        	描述：ztree1
        -->
		<script type="text/javascript">
			//设置url
			var URL="<%=request.getContextPath() %>/library/findNodesByParentId.do";
			//tree上方点击搜索按钮的id
			DAM._searchId('search');
			//tree上方搜索框id
			DAM._searchInput('searchInput');
			//tree下方ok按钮id
			DAM._okBtn('btn');
			//回显的input框id
			DAM._showInput('sss');
			//显示tree的div Id
			DAM._showDiv('diva');
			//利用某个按钮控制tree显示的按钮id
			DAM._showBtn('click');
			//tree下方关闭按钮id
			DAM._closeBtn('reset');
			//DAM._iconPathPrefix("/aisdjoias");
			//多选tree的选项，默认为false
			//DAM._isMulitSelect(true);
			//多选最大个数
			//DAM._mulitNum(8);
			//是否为异步自动加载 ,默认为true
			DAM._isAutoAsync(false);
			//此方法为手动异步加载
			//参数说明：
			//dataKey:dataKey 需要显示到树节点上的值得key
			//idKey : id的key
			//pIdKey : pid 的key
			//rootPid : 根节点pid的值
			//autoParam: 提交到后台的值 多个值之间用"，"隔开
			//url ： 需要提交到后台的url
			//treeId:树的id  前端展示的树
			DAM._initAsync('name','id','par_inst_id','','id,clasfCd',URL,'tree');
			//此方法为自动异步加载，数据多的情况下，页面会出现卡顿，数据多的情况下，慎用
			//[""id","name""]
			//["name"]
			//DAM._initAutoAsync('name','id','par_inst_id','','id,clasfCd',URL,'tree');
			function openShowInputMethod(nodes){
				console.log("重写."+nodes);
			}
		</script>
	</head>
	<body>
		<div style="width: 100%;">
			<!--
	        	作者：chinasofti
	        	时间：2018-01-25
	        	描述：ztree1
        	-->
            <div>
           		<input type="text" id="sss">
           		<button id="click">显示</button>
            </div>
			<div id="diva" style="overflow-y:auto;height:450px;width:300px;display:none;position:absolute">
				<input id="searchInput" type="text">
           		<button id="search">查询</button>
				<ul id="tree" class="ztree"></ul>
				<button id="btn">确定</button>
				<button id="reset">关闭</button>
			</div>
		</div>
	</body>
</html>